﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Text;
using xiaodingmarket_application.Interfaces;
using xiaodingmarket_Domain.Interfaces.IRepository;
using xiaodingmarket_Domain.Models;
using xiaodingmarket_Domain_core.Bus;
using xiaodingmarket_Infra_Data.Repository.EventStore;

namespace xiaodingmarket_application.Service
{
    public class RoleService : IRoleService
    {
        private readonly IMapper _mapper;
        private readonly IRoleRepository _roleRepository;
        private readonly IEventStoreRepository _eventStoreRepository;
        private readonly IMediatorHandler Bus;
        public RoleService(IMapper mapper,
                                  IRoleRepository orderRepository,
                                  IMediatorHandler bus,
                                  IEventStoreRepository eventStoreRepository)
        {
            _mapper = mapper;
            _roleRepository = orderRepository;
            Bus = bus;
            _eventStoreRepository = eventStoreRepository;
        }
        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }

        public Role GetRoleinfo(Guid id)
        {
            return _roleRepository.GetById(id);
        }
    }
}
